package com.huluobo.a2307douyindemo.home

import androidx.lifecycle.MutableLiveData
import com.huluobo.lib_base.bean.BannerBean
import com.huluobo.lib_base.bean.VideoBean
import com.huluobo.lib_base.mvvm.BaseViewModel
import com.huluobo.lib_base.net.ApiService
import com.youth.banner.Banner
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

/**
 *  Created by LC on 2025/9/24.
 */
@HiltViewModel
class HomeViewModel @Inject constructor(private val apiService: ApiService) : BaseViewModel() {
    val getHomeVideoSuccess by lazy { MutableLiveData<List<VideoBean>>() }
    fun getHomeVideo(currentPage: Int, pageSize: Int) {
        executeNetwork(
            { apiService.getVideos(currentPage, pageSize) },
            getHomeVideoSuccess::postValue
        )
    }

    val getHomeBannerSuccess by lazy { MutableLiveData<List<BannerBean>>() }
    fun getHomeBanner() {
        executeNetwork(
            { apiService.getHomeBanner() },
            getHomeBannerSuccess::postValue
        )
    }
}